package com.jwds.digital.bios.business.api.controller.basic;

import com.jwds.digital.bios.business.core.infrastructure.dto.belt.BasicPowerTypeReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.dto.feign.BasicMaterialReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.BasicPowerTypeRespVO;
import com.jwds.digital.bios.business.core.infrastructure.vo.feign.BasicMaterialRespVO;
import com.jwds.digital.bios.business.core.utils.FeignResultUtil;
import com.jwds.digital.bios.business.rpc.feign.BasicMaterialFeign;
import com.jwds.tdc.framework.application.lib.BaseResponse;
import com.jwds.tdc.framework.application.lib.page.PageRequest;
import com.jwds.tdc.framework.application.lib.page.PageResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @Description BasicMaterialController
 * @Author xiao  xun
 * @Date 2024-12-07
 */
@Slf4j
@Api(tags = "物料基础信息")
@RestController
@RequestMapping("/basic/material")
public class BasicMaterialController {
    @Resource
    private BasicMaterialFeign basicMaterialFeign;

    @PostMapping("/all")
    @ApiOperation(value = "列表查询")
    public BaseResponse<List<BasicMaterialRespVO>> list(@Valid @RequestBody BasicMaterialReqDTO reqDto) {
        List<BasicMaterialRespVO> basicMaterialRespVOList = FeignResultUtil.getDataFromBaseResponse(basicMaterialFeign.list(reqDto));
        return BaseResponse.success(basicMaterialRespVOList);
    }

}
